package com.ruoyi.resume.domain.model;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@Data
public class MajorCategory {
    // 专业分类及其包含的专业列表
    private Map<String, List<String>> majorCategories;

    public static void main(String[] args) {
        MajorCategory majorCategory;
        try {
            File majorFile = ResourceUtils.getFile("classpath:majors.json");  // 读取资源文件
            ObjectMapper objectMapper = new ObjectMapper();
            majorCategory = objectMapper.readValue(majorFile, MajorCategory.class);
            System.out.println(majorCategory.getMajorCategories());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
